package view.components;

import graphs.AbstractGraph;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import view.GedivaGUI;

/**
 * The panel to hold the graph image
 * 
 * @author Vijay Ram
 */
public class GraphPanel extends JPanel
{
    private static final long serialVersionUID = 1L;

    /**
     * Create panel that will update the given view.
     */
    public GraphPanel(GedivaGUI gedivaGUI)
    {
        initializePanel();
    }

    public void initializePanel()
    {
        this.removeAll();
        ImageIcon image = new ImageIcon("gediva/data/splashscreen.png",
                "what a beautiful baby");
        JLabel imageLabel = new JLabel(image);
        this.add(imageLabel);
    }

    @SuppressWarnings("unchecked")
    public void replaceGraph(AbstractGraph abstractGraph)
    {
        this.removeAll();
        this.add(abstractGraph);
    }

}
